import time
import yaml
from web_wechat_po.page_object.base_page import BasePage


class LoginPage(BasePage):
    _BASE_URL = "https://work.weixin.qq.com/wework_admin/frame"
    def login(self):
        with open("../data/cookie.yaml", "r") as f:
            cookie = yaml.safe_load(f)
        for i in cookie:
            self.driver.add_cookie(i)
        time.sleep(3)
        self.driver.get("https://work.weixin.qq.com/wework_admin/frame")
        # ==》首页
        # 跳转到下一个类
        from web_wechat_po.page_object.home_page import HomePage
        return HomePage(self.driver)